<template>
<div class="box">子组件

{{ user.name }}

 <Provide2></Provide2>
 <Provide2_2></Provide2_2>
</div>
</template>
<script setup lang='ts'> 
 import {ref,reactive, inject} from 'vue';
 import Provide2 from './Provide2.vue';
 import Provide2_2 from './Provide2_2.vue';

 const user= inject<any>('user'); // 获取 provide 的值

</script>
<style scoped lang='less'>
.box{
    width: 100%;
    height: 300px;
    background-color: red;
}
</style>